home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Balloons.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  9.9 KB  |  224 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Saturday, January 12, 1991 at 4:19 PM
  3.     Balloons.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc. 1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Balloons;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingBalloons}
  21. {$SETC UsingBalloons := 1}
  22.  
  23. {$I+}
  24. {$SETC BalloonsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingTypes}
  27. {$I $$Shell(PInterfaces)Types.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingQuickdraw}
  30. {$I $$Shell(PInterfaces)Quickdraw.p}
  31. {$ENDC}
  32. {$IFC UNDEFINED UsingMenus}
  33. {$I $$Shell(PInterfaces)Menus.p}
  34. {$ENDC}
  35. {$IFC UNDEFINED UsingTextEdit}
  36. {$I $$Shell(PInterfaces)TextEdit.p}
  37. {$ENDC}
  38. {$IFC UNDEFINED UsingTraps}
  39. {$I $$Shell(PInterfaces)Traps.p}
  40. {$ENDC}
  41. {$SETC UsingIncludes := BalloonsIncludes}
  42.  
  43. CONST
  44. hmBalloonHelpVersion = $0002;   { The real version of the Help Manager }
  45.  
  46. {Help Mgr error range: -850 to -874}
  47. hmHelpDisabled = -850;          { Show Balloons mode was off, call to routine ignored }
  48. hmBalloonAborted = -853;        { Returned if mouse was moving or mouse wasn't in window port rect }
  49. hmSameAsLastBalloon = -854;     { Returned from HMShowMenuBalloon if menu & item is same as last time }
  50. hmHelpManagerNotInited = -855;  { Returned from HMGetHelpMenuHandle if help menu not setup }
  51. hmSkippedBalloon = -857;        { Returned from calls if helpmsg specified a skip balloon }
  52. hmWrongVersion = -858;          { Returned if help mgr resource was the wrong version }
  53. hmUnknownHelpType = -859;       { Returned if help msg record contained a bad type }
  54. hmOperationUnsupported = -861;  { Returned from HMShowBalloon call if bad method passed to routine }
  55. hmNoBalloonUp = -862;           { Returned from HMRemoveBalloon if no balloon was visible when call was made }
  56. hmCloseViewActive = -863;       { Returned from HMRemoveBalloon if CloseView was active }
  57. kHMHelpMenuID = -16490;         { Resource ID and menu ID of help menu }
  58. kHMAboutHelpItem = 1;           { help menu item number of About Balloon Help… }
  59. kHMShowBalloonsItem = 3;        { help menu item number of Show/Hide Balloons }
  60. kHMHelpID = -5696;              { ID of various Help Mgr package resources (in Pack14 range) }
  61. kBalloonWDEFID = 126;           { Resource ID of the WDEF proc used in standard balloons }
  62.  
  63. {Dialog item template type}
  64. helpItem = 1;                   { key value in DITL template that corresponds to the help item }
  65.  
  66. { Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  67. hmDefaultOptions = 0;           { default options for help manager resources }
  68. hmUseSubID = 1;                 { treat resID's in resources as subID's of driver base ID }
  69. hmAbsoluteCoords = 2;           { ignore window port origin and treat rectangles as absolute coords }
  70. hmSaveBitsNoWindow = 4;         { don't create a window, just blast bits on screen. No update event is generated }
  71. hmSaveBitsWindow = 8;           { create a window, but restore bits behind window when window goes away }
  72. hmMatchInTitle = 16;            { for hwin resources, match string anywhere in window title string }
  73.  
  74. { Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  75. kHMStringItem = 1;              { pstring used in resource }
  76. kHMPictItem = 2;                { 'PICT' ResID used in resource }
  77. kHMStringResItem = 3;           { 'STR#' ResID & index used in resource }
  78. kHMTEResItem = 6;               { Styled Text Edit ResID used in resource ('TEXT' & 'styl') }
  79. kHMSTRResItem = 7;              { 'STR ' ResID used in resource }
  80. kHMSkipItem = 256;              { don't display a balloon }
  81. kHMCompareItem = 512;           { Compare pstring in menu item w/ PString in resource item }
  82. kHMNamedResourceItem = 1024;    { Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) }
  83. kHMTrackCntlItem = 2048;        { Reserved }
  84.  
  85. { Constants for hmmHelpType's when filling out HMMessageRecord }
  86. khmmString = 1;                 { help message contains a PString }
  87. khmmPict = 2;                   { help message contains a resource ID to a 'PICT' resource }
  88. khmmStringRes = 3;              { help message contains a res ID & index to a 'STR#' resource }
  89. khmmTEHandle = 4;               { help message contains a Text Edit handle }
  90. khmmPictHandle = 5;             { help message contains a Picture handle }
  91. khmmTERes = 6;                  { help message contains a res ID to 'TEXT' & 'styl' resources }
  92. khmmSTRRes = 7;                 { help message contains a res ID to a 'STR ' resource }
  93. kHMTETextResType = 'TEXT';      { Resource Type of text data for styled TE record w/o style info }
  94. kHMTEStyleResType = 'styl';     { Resource Type of style information for styled TE record }
  95.  
  96. {Generic defines for the switch items used in 'hmnu' & 'hdlg'}
  97. kHMEnabledItem = 0;             { item is enabled, but not checked or control value = 0 }
  98. kHMDisabledItem = 1;            { item is disabled, grayed in menus or disabled in dialogs }
  99. kHMCheckedItem = 2;             { item is enabled, and checked or control value = 1 }
  100. kHMOtherItem = 3;               { item is enabled, and control value > 1 }
  101.  
  102. { Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages }
  103. kHMMenuResType = 'hmnu';        { ResType of help resource for supporting menus }
  104. kHMDialogResType = 'hdlg';      { ResType of help resource for supporting dialogs }
  105. kHMWindListResType = 'hwin';    { ResType of help resource for supporting windows }
  106. kHMRectListResType = 'hrct';    { ResType of help resource for rectangles in windows }
  107. kHMOverrideResType = 'hovr';    { ResType of help resource for overriding system balloons }
  108. kHMFinderApplResType = 'hfdr';  { ResType of help resource for custom balloon in Finder }
  109.  
  110. { constants to pass to method parameter in HMShowBalloon }
  111. kHMRegularWindow = 0;           { Create a regular window floating above all windows }
  112. kHMSaveBitsNoWindow = 1;        { Just save the bits and draw (for MDEF calls) }
  113. kHMSaveBitsWindow = 2;          { Regular window, save bits behind, AND generate update event }
  114.  
  115. TYPE
  116. HMStringResType = RECORD
  117.     hmmResID: INTEGER;
  118.     hmmIndex: INTEGER;
  119.     END;
  120.  
  121. HMMessageRecPtr    = ^HMMessageRecord;
  122. HMMessageRecord    = RECORD
  123.                 hmmHelpType            : INTEGER;
  124.                 CASE INTEGER OF
  125.                 khmmString:
  126.                     (hmmString: STR255);
  127.                 khmmPict:
  128.                     (hmmPict: INTEGER);
  129.                 khmmStringRes:
  130.                     (hmmStringRes: HMStringResType);
  131.                 khmmTEHandle:
  132.                     (hmmTEHandle: TEHandle);
  133.                 khmmPictHandle:
  134.                     (hmmPictHandle: PicHandle);
  135.                 khmmTERes:
  136.                     (hmmTERes: INTEGER);
  137.                 khmmSTRRes:
  138.                     (hmmSTRRes: INTEGER);
  139.                 END;
  140.  
  141.  
  142.  
  143. {  Public Interfaces  }
  144. FUNCTION HMGetHelpMenuHandle(VAR mh: MenuHandle): OSErr;
  145.     INLINE $303C,$0200,_Pack14;
  146. FUNCTION HMShowBalloon(aHelpMsg: HMMessageRecord;
  147.                        tip: Point;
  148.                        alternateRect: RectPtr;
  149.                        tipProc: Ptr;
  150.                        theProc: INTEGER;
  151.                        variant: INTEGER;
  152.                        method: INTEGER): OSErr;
  153.     INLINE $303C,$0B01,_Pack14;
  154. FUNCTION HMRemoveBalloon: OSErr;
  155.     INLINE $303C,$0002,_Pack14;
  156. FUNCTION HMGetBalloons: BOOLEAN;
  157.     INLINE $303C,$0003,_Pack14;
  158. FUNCTION HMSetBalloons(flag: BOOLEAN): OSErr;
  159.     INLINE $303C,$0104,_Pack14;
  160. FUNCTION HMShowMenuBalloon(itemNum: INTEGER;
  161.                            itemMenuID: INTEGER;
  162.                            itemFlags: LONGINT;
  163.                            itemReserved: LONGINT;
  164.                            tip: Point;
  165.                            alternateRect: RectPtr;
  166.                            tipProc: Ptr;
  167.                            theProc: INTEGER;
  168.                            variant: INTEGER): OSErr;
  169.     INLINE $303C,$0E05,_Pack14;
  170. FUNCTION HMGetIndHelpMsg(whichType: ResType;
  171.                          whichResID: INTEGER;
  172.                          whichMsg: INTEGER;
  173.                          whichState: INTEGER;
  174.                          VAR options: LONGINT;
  175.                          VAR tip: Point;
  176.                          VAR altRect: Rect;
  177.                          VAR theProc: INTEGER;
  178.                          VAR variant: INTEGER;
  179.                          VAR aHelpMsg: HMMessageRecord;
  180.                          VAR count: INTEGER): OSErr;
  181.     INLINE $303C,$1306,_Pack14;
  182. FUNCTION HMIsBalloon: BOOLEAN;
  183.     INLINE $303C,$0007,_Pack14;
  184. FUNCTION HMSetFont(font: INTEGER): OSErr;
  185.     INLINE $303C,$0108,_Pack14;
  186. FUNCTION HMSetFontSize(fontSize: INTEGER): OSErr;
  187.     INLINE $303C,$0109,_Pack14;
  188. FUNCTION HMGetFont(VAR font: INTEGER): OSErr;
  189.     INLINE $303C,$020A,_Pack14;
  190. FUNCTION HMGetFontSize(VAR fontSize: INTEGER): OSErr;
  191.     INLINE $303C,$020B,_Pack14;
  192. FUNCTION HMSetDialogResID(resID: INTEGER): OSErr;
  193.     INLINE $303C,$010C,_Pack14;
  194. FUNCTION HMSetMenuResID(menuID: INTEGER;
  195.                         resID: INTEGER): OSErr;
  196.     INLINE $303C,$020D,_Pack14;
  197. FUNCTION HMBalloonRect(aHelpMsg: HMMessageRecord;
  198.                        VAR coolRect: Rect): OSErr;
  199.     INLINE $303C,$040E,_Pack14;
  200. FUNCTION HMBalloonPict(aHelpMsg: HMMessageRecord;
  201.                        VAR coolPict: PicHandle): OSErr;
  202.     INLINE $303C,$040F,_Pack14;
  203. FUNCTION HMScanTemplateItems(whichID: INTEGER;
  204.                              whichResFile: INTEGER;
  205.                              whichType: ResType): OSErr;
  206.     INLINE $303C,$0410,_Pack14;
  207. FUNCTION HMExtractHelpMsg(whichType: ResType;whichResID: INTEGER;whichMsg: INTEGER;
  208.     whichState: INTEGER;VAR aHelpMsg: HMMessageRecord): OSErr;
  209.     INLINE $303C,$0711,_Pack14;
  210. FUNCTION HMGetDialogResID(VAR resID: INTEGER): OSErr;
  211.     INLINE $303C,$0213,_Pack14;
  212. FUNCTION HMGetMenuResID(menuID: INTEGER;VAR resID: INTEGER): OSErr;
  213.     INLINE $303C,$0314,_Pack14;
  214. FUNCTION HMGetBalloonWindow(VAR window: WindowPtr): OSErr;
  215.     INLINE $303C,$0215,_Pack14;
  216.  
  217.  
  218. {$ENDC}    { UsingBalloons }
  219.  
  220. {$IFC NOT UsingIncludes}
  221.     END.
  222. {$ENDC}
  223.  
  224.